/**
 * Created by cql-cql-cql on 2017/6/2 0002.
 */
const mongoose = require('mongoose');

//user
var UserlSchema = new mongoose.Schema({
    code: {
        type: String,
        unique: true,
        required: true
    },
    name:String,
    pwd: {
        type: String,
        required: true
    },
    email: {
        type: String,
    },
    power: {
        type: String,
        default: 5,
    },
    reg_time: {
        type: Date,
        default: Date.now()
    },
    className:Array,
    lassCode:String,
    token: String,
});
UserlSchema.pre('save', function(next) {
    next();
})
var UserModel = mongoose.model('User', UserlSchema);
module.exports = UserModel
